<?php $SS = new Zend_Session_Namespace ('Language');

$lang = $SS->language;
$langTitle = $this->data['name'];
if($lang == "en"){
$langTitle = $this->data['name_en'];  
}elseif($lang == "chi"){
$langTitle = $this->data['name_china']; 
}

$langDesc = $this->data['description'];
if($lang == "en"){
$langDesc = $this->data['description_en'];  
}elseif($lang == "chi"){
$langDesc = $this->data['description_china']; 
}

$langContent = $this->data['content'];
if($lang == "en"){
$langContent = $this->data['content_en'];  
}elseif($lang == "chi"){
$langContent = $this->data['content_china']; 
}
$langProduction = "Nguồn gốc";
if($lang == "en"){
$langProduction = "Production";  
}elseif($lang == "chi"){
$langProduction = "生產";
}

$langProductSame = "Sản phẩm tương tự";
if($lang == "en"){
$langProductSame = "Same products";  
}elseif($lang == "chi"){
$langProductSame = "生產";
}
$langOrder = "Mua hàng";
if($lang == "en"){
$langOrder = "Order";  
}elseif($lang == "chi"){
$langOrder = "秩序";
}
$langDetail = "Chi tiết";
if($lang == "en"){
$langDetail = "Detail";  
}elseif($lang == "chi"){
$langDetail = "細節";
}

?>  
<div class="head-content"><?php echo $langTitle;?></div>
<div class="fix content-site" style="position: relative;">
    <?php echo $langContent;?>
    <div class="cart-order">
        <a onclick="orderPro(<?php echo $this->data['id'];?>)" class="bt-cart"><?php echo $langOrder;?></a>
    </div>
</div>
<div class="line-content"></div>
<div class="madein-detail"><?php echo $langProduction;?> : <?php echo $this->data['madein'];?></div>
<div class="price-detail"><?php echo number_format($this->data['price']);?> VND/kg</div>
<div class="other-news product-fix news-fix">
    <div class="head-content"><?php echo $langProductSame;?></div>
    <?php foreach($this->otherData as $vl): 
 
$langTitle2 = $vl['name'];
if($lang == "en"){
$langTitle2 = $vl['name_en'];  
}elseif($lang == "chi"){
$langTitle2 = $vl['name_china']; 
}
    ?>
    <div class="item">
        <div class="image">
            <a href="<?php echo "/san-pham/".$vl['id']."-".$this->cleanstring($lang == "en" ? $vl['name_en'] : $vl['name']).".html";?>" title="<?php echo $lang == "en" ? $vl['name_en'] : $vl['name'];?>"><img src="<?php echo $this->baseUrl()."/upload/".$vl['image'];?>" alt="<?php echo $lang == "en" ? $vl['name_en'] : $vl['name'];?>" width="214" height="125"/></a>
        </div>
        <div class="info">
            <p class="title"><a href="<?php echo "/san-pham/".$vl['id']."-".$this->cleanstring($lang == "en" ? $vl['name_en'] : $vl['name']).".html";?>" title="<?php echo $lang == "en" ? $vl['name_en'] : $vl['name'];?>"> <?php echo $this->Substring($langTitle2,  50);?></a></p>
            <p class="madein"><?php echo $langProduction;?>  : <?php echo $vl['madein'];?></p>
            <p class="madein"><?php echo number_format($vl['price']);?> VNĐ/kg</p>
            <p class="bt-news-detail"><a href="<?php echo "/san-pham/".$vl['id']."-".$this->cleanstring($lang == "en" ? $vl['name_en'] : $vl['name']).".html";?>" title="<?php echo $lang == "en" ? $vl['name_en'] : $vl['name'];?>"> >> <?php echo $langDetail;?></a></p>
        </div>
    </div>
    <?php endforeach;?>
</div>
<script>
function orderPro(id){
    $.ajax({
                    type: "GET",
                    url: "/orders/add",
                    data: "id="+id,
                    dataType: "json",
                    success: function(data){
                      alert(data.message);
                      window.location.href = "/orders";
                    }
                });
}
</script>
